const {
	defineConfig
} = require('@vue/cli-service')
module.exports = defineConfig({
	transpileDependencies: true,
	// 配置本地服务器
	devServer: { // 开启代理
		proxy: {
			"/v1": {
				target: "https://bzapi.endata.com.cn", //目标
				changeOrigin: true, // 跨域
				onProxyReq(req) {
					req.setHeader("Referer", "https://bzapi.endata.com.cn"),
						req.setHeader("authorization",
							"bearer V_FNYqjECI06_mzVTyBIy_3RuVXK3Xy82sIOXQYWvdonTTtBfB2c9fJphIhYZveaBTmp3VGAw6Bj5sdf22QeQCrMXenWPwjmrAUTwGdROj3Ynd-AIkuuvw4LUlzpujDNPAiqqMrwGep1D-gCiVgDhrFJ-qrMAeTyFUpEes6YxGWW8JsVDvtrmxsDn6onNZ-14gb-tOrcGeoPWZNFnNZHHdlfsEsDc-_uMwGn6CiKcFQ"
						),
						req.setHeader("origin", "https://bz.endata.com.cn")
				}
			},
			"V1": {
				target: "https://bzapi.endata.com.cn", //目标
				changeOrigin: true, // 跨域
				onProxyReq(req) {
					req.setHeader("Referer", "https://bzapi.endata.com.cn"),
						req.setHeader("authorization",
							"bearer V_FNYqjECI06_mzVTyBIy_3RuVXK3Xy82sIOXQYWvdonTTtBfB2c9fJphIhYZveaBTmp3VGAw6Bj5sdf22QeQCrMXenWPwjmrAUTwGdROj3Ynd-AIkuuvw4LUlzpujDNPAiqqMrwGep1D-gCiVgDhrFJ-qrMAeTyFUpEes6YxGWW8JsVDvtrmxsDn6onNZ-14gb-tOrcGeoPWZNFnNZHHdlfsEsDc-_uMwGn6CiKcFQ"
						),
						req.setHeader("origin", "https://bz.endata.com.cn")
				},
			},
			"/api": { // 对dida100进行代理
				target: "http://dida100.com:8888",
				changeOrigin: true
			},
			"/bfs": {
				target: "http://i1.hdslb.com", //目标
				changeOrigin: true, // 跨域
				onProxyReq(req) {
					req.setHeader("sec-fetch-site", "cross-site")
					req.setHeader("pragma", "no-cache")
					req.setHeader("cache-control", "no-cache")
					req.setHeader("upgrade-insecure-requests", "1")
					req.setHeader("Referer", "https://i1.hdslb.com"),
					req.setHeader("origin", "https://i1.hdslb.com")
				}
			}
		}
	}
})
